#ifndef __DISPLAY_H
#define __DISPLAY_H
#include <Adafruit_GFX.h>
#include <FastLED.h>
#include <Arduino.h>
#include <FastLED_NeoMatrix.h>
#include "config.h"
#include "images.h"

class Displayer
{
private:
  /* data */
  CRGB leds[MATRIX_NUM_LEDS];

public:
  Displayer(/* args */);
  ~Displayer();

  void Example_Fire();
  void Example_Marquee();

  void Display(int[], int, CRGB);
  void Clear();
};

class MatrixDisplayer : public FastLED_NeoMatrix
{
private:
  bool enable_show = true;
  void init();
public:
  MatrixDisplayer();
  ~MatrixDisplayer();
  void show(void);

  void Example_Neo_Print();
  void Example_Animation();
  void Example_Neo_Image();

  void RestoreLeds();
  void SetLeds(CRGB *l);

  void SetShowEnable(bool enable_show);

  void ShowMessage(char *message, int len, uint32_t color);
  void Print(char *s, int x, int y, CRGB color);
  void PixelAnimation(int16_t ***frames, int frame_size, int frames_num, int interval, CRGB color);

  void DrawIcon(int16_t x, int16_t y, const image_t *img);
  void DrawIconAnimation(int16_t x, int16_t *y, int16_t end_y, const image_t *img);

  void PrintAnimation(char *s, int start_x, int end_x, int *x, CRGB color);
  void PrintAnimation(char *s[], int start_x, int end_x, int *x, int offsets[], CRGB colors[], int length);

  void DrawBitmapRawRGB(int16_t x, int16_t y, CRGB led[MATRIX_NUM_LEDS]);
};

extern CRGB _leds[MATRIX_NUM_LEDS];
extern MatrixDisplayer *displayManager; // 声明 displayManager 变量，用于在其他文件中访问 MatrixDisplayer 对象

const uint16_t* getDisplayBitmap16(CRGB leds[]);


#endif